package com.starry.push.netty.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author WuChao
 * @version 1.0
 * @date 2020/11/3 15:57
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "log_ws_connect")
public class LogWsConnect {
    public static final String COL_SERVER_PORT = "server_port";
    @TableId(value = "id", type = IdType.ID_WORKER_STR)
    private String id;

    /**
     * 使用长id
     */
    @TableField(value = "channel_id")
    private String channelId;

    /**
     * 0-已连接
     * 1-已注册，只有此状态的连接才是有效的
     * 2-注册失败
     * 3-已下线
     */
    @TableField(value = "status")
    private Integer status;

    /**
     * 客户端
     */
    @TableField(value = "client_type")
    private String clientType;

    /**
     * 客户端主机地址
     */
    @TableField(value = "server_host")
    private String serverHost;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private LocalDateTime createTime;

    /**
     * 唯一标识
     */
    @TableField(value = "unique_identification")
    private String uniqueIdentification;

    public static final String COL_ID = "id";

    public static final String COL_CHANNEL_ID = "channel_id";

    public static final String COL_STATUS = "status";

    public static final String COL_CLIENT_TYPE = "client_type";

    public static final String COL_SERVER_HOST = "server_host";

    public static final String COL_CREATE_TIME = "create_time";

    public static final String COL_UNIQUE_IDENTIFICATION = "unique_identification";
}